package com.mtw.bbs.userAdmin.pojo.dto;


import com.mtw.bbs.userAdmin.pojo.vo.BaseUserVo;
import com.mtw.bbs.userAdmin.pojo.vo.ResourceVo;
import com.mtw.bbs.userAdmin.pojo.vo.UserInfoVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

@EqualsAndHashCode(callSuper = true)
@Data
public class UserDto extends BaseUserVo implements Serializable {


    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 账号
     */
    @ApiModelProperty(value = "账号")
    private String username;
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    private String password;
    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String email;
    /**
     * 手机
     */
    @ApiModelProperty(value = "手机")
    private String phone;
    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    private String displayName;

    /**
     * 生日
     */
    @ApiModelProperty(value = "生日")
    private Date birthday;
    /**
     * 性别，（1是男，0为女）
     */
    @ApiModelProperty(value = "性别，（1是男，0为女）")
    private Integer sex;
    /**
     * 星座
     */
    @ApiModelProperty(value = "星座")
    private String constellation;
    /**
     * 签名
     */
    @ApiModelProperty(value = "签名")
    private String introduction;
    /**
     * 地区
     */
    @ApiModelProperty(value = "地区")
    private String address;

    /**
     * 用户类型
     */
    @ApiModelProperty(value = "用户类型")
    private Integer userType;

    /**
     * 评论状态[1:正常，0禁言]
     */
    @ApiModelProperty(value = "评论状态")
    private Integer commentStatus;

    /**
     * 业务状态[1:正常]
     */
    @ApiModelProperty(value = "业务状态")
    private Integer status;

    /**
     * 资源集合
     */
    @ApiModelProperty(value = "资源集合")
    private Set<ResourceVo> resource;


    /**
     * 简单信息
     */
    public UserInfoVo toSimpleInfoVO(){
        UserInfoVo vo = new UserInfoVo();
        vo.setUsername(this.getUsername());
        vo.setDisplayName(this.getDisplayName());
        vo.setSex(this.getSex());
        vo.setAvatar(this.getAvatar());
        return vo;
    }

}
